package com.hollycrm.unicom.sheet.business.web;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.hollycrm.springframework.web.struts.DispatchActionSupport;
import com.hollycrm.unicom.sheet.BeanResource;
import com.hollycrm.unicom.sheet.business.BusinessSupportManager;

/**
 * ListDealSheetAction
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author Tian Kai
 * @version 1.0
 */
public class ListAcceptRecordAction
    extends DispatchActionSupport {
    /**
     * execDefault
     *
     * @param mapping ActionMapping
     * @param actionForm ActionForm
     * @param request HttpServletRequest
     * @param response HttpServletResponse
     * @throws Exception
     * @return ActionForward
     */
    public ActionForward execDefault(ActionMapping mapping,
                                     ActionForm actionForm,
                                     HttpServletRequest request,
                                     HttpServletResponse response) throws
        Exception {
        String mainSheetFlowNO = request.getParameter("sheetFlowNO");
        BusinessSupportManager bsm = (BusinessSupportManager)
            getBean(BeanResource.BUSINESSSUPPORT_MANAGER);
        List acceptRecords = bsm.listAcceptRecords(mainSheetFlowNO);
        request.setAttribute("acceptRecords", acceptRecords);
        return mapping.findForward("success");
    }

    /**
     *
     * @param mapping
     * @param actionForm
     * @param request
     * @param response
     * @return
     * @throws java.lang.Exception
     */
//    public ActionForward execRelateRecord(ActionMapping mapping,
//                                     ActionForm actionForm,
//                                     HttpServletRequest request,
//                                     HttpServletResponse response) throws
//        Exception {
//        AcceptForm form = (AcceptForm)actionForm;
//        String mainSheetFlowNO = form.getAcceptRecord().getMainSheetFlowNO();
//        String recordID = form.getAcceptRecord().getRecordID();
//        BusinessSupportManager bsm = (BusinessSupportManager)
//            getBean(BeanResource.BUSINESSSUPPORT_MANAGER);
//        List acceptRecords = bsm.listRelateAcceptRecords(mainSheetFlowNO,recordID);
//        request.setAttribute("acceptRecords", acceptRecords);
//        return mapping.findForward("success");
//    }


}
